package com.jxb.e20241230;

public class MostWater1_11 {
    public static void main(String[] args) {

    }








    public static int getMaxWater(int[] nums) {
        int maxValue = 0;
        //定义2个指针
        int i = 0;
        int j = nums.length - 1;
        while (i<j) {
            maxValue = nums[i] < nums[j] ?
                    Math.max(maxValue,(j-i)*nums[i++]) :
                    Math.max(maxValue,(i-j)*nums[j--]);
        }
        return maxValue;
    }
}
